/*
 * test.cpp
 *
 *  Created on: 2013/01/31
 *      Author: fit
 */
#include <stdio.h>
#include "iacmd.h"

int main(int argc, char* const* argv)
{
	iacmd cmd;
	char value = 100;
	cmd.settype(set);

	cmd.add(1);
	cmd.add(2, 1, &value);
	cmd.add(3);

	char buf[32] = { 0 };
	unsigned int size = cmd.read(buf, 32);
	for (int i = 0; i < 32; i++)
	{
		printf("%02X ", buf[i]);
		if ((i + 1) % 16 == 0) printf("\n");
	}

	iacmd cmd_recv(buf, size);
	for (int i = 0; i < cmd_recv.count(); i++)
	{
		printf("param: %d, cnt: %d \n",cmd_recv[i]->param, cmd_recv[i]->cnt);
	}
}

